#pragma once

#include "libmesh/fe_type.h"
#include "libmesh/libmesh.h"

namespace libMesh
{
	class DofMap;
	class Elem;
	class CouplingMatrix;
	class System;
	template <typename T> class FEGenericBase;
	using FEBase = FEGenericBase<Real>;
	class MeshBase;
}
using namespace libMesh;

class Context
{
public:
	Context(System&sys, unsigned int tid);
	virtual ~Context();

	void init();
	void reinitElem();
	void reinitNeighbor();
	void reintiElemSide(unsigned int iside);
private:
	System& _sys;
	unsigned int _tid;
	DofMap& _dof_map;

	MeshBase& _mesh;
	size_t _dim;

	const Elem* _current_elem;
	const Elem* _current_neighbor_elem;
	const Elem* _current_elem_side;

	FEType _fe_type;
	std::unique_ptr<FEBase> _fe_elem;
	std::unique_ptr<FEBase> _fe_side;
	
};
